Adding sqlc advanced option#401
Conversation
…t allowing for a forced shutdown during graceful shutdown.
As the @tailwindcss/vite is installed and only supports v4 we are using --prefer-offline flag that can install tailwindcss v3 from cache with this we force to use cache only is tailwindcss version is greater than v4
| name: Install Sqlc & gen code | ||
| run: | | ||
| go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest | ||
| /home/runner/go/bin/sqlc generate -f ${{ env.PROJECT_DIRECTORY }}/sqlc.yaml |
There was a problem hiding this comment.
Can't this lead to breaking changes if the go bin is not in /hom/runne/go/bin?
There was a problem hiding this comment.
Well this is the same way templ is installed, and unless the name of the runner user changes (which is highly unlikely) it should work fine
There was a problem hiding this comment.
You could use $(go env GOPATH)/bin/sqlc instead of /home/runner/go/bin/sqlc
| } | ||
|
|
||
| steps := steps.InitSteps(flagFramework, flagDBDriver) | ||
| optionSteps := steps.InitSteps(flagFramework, flagDBDriver) |
There was a problem hiding this comment.
Because I needed to use the 'steps' package later
cmd/create.go
Outdated
| if project.DBDriver != flags.Postgres && project.DBDriver != flags.MySql && project.DBDriver != flags.Sqlite { | ||
| step.Options = slices.DeleteFunc(step.Options, func(s steps.Item) bool { return s.Flag == "Sqlc" }) |
There was a problem hiding this comment.
I think there is a cleaner way to do this
There was a problem hiding this comment.
Idk this is the most seamless solution I could come up with for the UX. Although I agree the code is a bit jank, have any suggestions?
There was a problem hiding this comment.
I think this is a cleaner solution
supportedDrivers := []flags.Database{flags.Postgres, flags.MySql, flags.Sqlite}
if !slices.Contains(supportedDrivers, project.DBDriver) {
step.Options = slices.DeleteFunc(step.Options, func(s steps.Item) bool {
return s.Flag == "Sqlc"
})
}There was a problem hiding this comment.
thanks I'll add that right now
Co-authored-by: Ujstor <116409846+Ujstor@users.noreply.github.com>
* adding workflow and script to support npm distribution * refactor npm workflow * fixing workflow for npm publisher * improve npm authentication in workflow * updating docs for installation
|
@Melkeydev Just checking in, but are you able to merge this PR now after it addressed the feedback? |
|
@StevenACoffman @Melkeydev There’s still some documentation that needs to be updated with the recent changes. I’ve already opened a PR to the sqlc branch of @eggplannt with those updates, but it hasn’t been merged yet. |
Update sqlc branch with latest main and add documentation
|
Are there any updates on this pull request? |
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Problem/Feature
Please include a description of the problem or feature this PR is addressing.
Description of Changes:
Querytodatabase.servicefor relevant driverscloses #400
Checklist